package com.icongyou.enterprise.talent_pool.mapper;

import com.icongyou.enterprise.talent_pool.entity.AssignmentTagEntity;
import com.icongyou.enterprise.talent_pool.entity.vo.AssignmentTagVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface AssignmentTagMapper {

    // 批量插入任务-标签关联
    void batchInsertAssignmentTags(List<AssignmentTagEntity> assignmentTags);

    int deleteByTagIdAndAssignmentIds(
            @Param("tagId") String tagId,
            @Param("assignmentIds") List<String> assignmentIds
    );

    // 根据任务ID删除关联
    void deleteByAssignmentIds(@Param("assignmentIds") List<String> assignmentIds);

    // 获取需要计算的任务ID（增量计算）
    List<String> getAssignmentsToCalculate(@Param("lastCalculationTime") LocalDateTime lastCalculationTime);

    // 获取课程总分
    Double getCourseTotalScore(@Param("courseId") String courseId);

    // 获取所有标签ID
    List<String> getAllTagIds();

    // 获取所有已截止的任务ID
    List<String> getAllCompletedAssignments();

    // 根据标签ID获取所有任务关联
    List<AssignmentTagEntity> getAssignmentTagsByTagId(String tagId);

    List<AssignmentTagVO> getAssignmentTagVOsByTagId(String tagId);
}